<?php
/**
 * 全局配置文件
 *
 * @author 孙晓晔
 * @version $Id: config.php 1033 2010-03-25 11:26:55Z sunxy $
 */

date_default_timezone_set('PRC');

function cur_time() {
	$mtime = explode(" ", microtime());
	return $mtime[1] + $mtime[0];
}

function logdate() {
	$starttime = $_REQUEST['starttime'];

	$endtime = cur_time();
	$totaltime = (cur_time() - $starttime);
	$totaltime = number_format($totaltime, 7);

	echo "\n";
	echo "starttime = " . date("Y-m-d H:i:s", $starttime) . "\n";
	echo "endtime = " . date("Y-m-d H:i:s", $endtime) . "\n";
	echo "totaltime = " . $totaltime . "\n";
}

$_REQUEST['starttime'] = cur_time();

if (!defined('SMARTY_LIB')) define('SMARTY_LIB', APP_LIB);

$cfg['mysql'] = array(
	"admin" => array("host"=>"127.0.0.1", "user"=>"sunxy", "pass"=>"test", "db"=>"admin"),
	"test" => array("host"=>"127.0.0.1", "user"=>"sunxy", "pass"=>"test", "db"=>"test"),
	"wifi" => array("host"=>"127.0.0.1", "user"=>"sunxy", "pass"=>"test", "db"=>"wifi"),
);

$cfg['mogilefs'] = array(
	'tec' => array('host'=>'localhost', 'port'=>7001, 'domain'=>'image', 'class'=>'upload'),
	'test' => array('host'=>'localhost', 'port'=>7001, 'domain'=>'image', 'class'=>'upload'),
);

$cfg['memcached'] = array(
	'root' => array('host'=>'localhost', 'port'=>11211),
	'test' => array('host'=>'localhost', 'port'=>11211),
);

require_once(dirname(__FILE__) . "/function.php");
require_once(dirname(__FILE__) . "/Constant.class.php");

require_once(APP_LIB . "/Common.class.php");
require_once(APP_LIB . "/Name.class.php");
require_once(APP_LIB . "/Id.class.php");
require_once(APP_LIB . "/Download.class.php");
?>
